import React, {Component} from 'react'
import {render} from 'react-dom'
// import axios from 'axios'

class jsPoint extends Component {
    constructor(props) {
        super(props);
        this.state = {
            ajaxData:[]
        };
    }

    componentDidMount (){
        this.getData()
    }
   componentWillMount(){

   }
   componentWillUnMount(){

   }

    getData (){
        // axios.get("../../public/data/demo.json")
        //         .then((result){
        //             this.setState({"ajaxData": result.data[0].name}) 
        //         })
        //         .catch((err){
        //             console.log(err.status)
        //         })
    }
    
    render() {

        return (
            <div>
                <h1>ajax方式:fetch \ superagent \ fetch polyfill \ reqwest \ axios</h1>
                 {
                     this.state.ajaxData
                 }
            </div>
        )
    }
}

// jsPoint.propType = {
    // name :  React.PropTypes.string.isRequired
// }

export default jsPoint
